package com.unidt.www.module.expert.controller.admin;

import com.unidt.www.framework.common.pojo.CommonResult;
import com.unidt.www.framework.common.pojo.PageResult;
import com.unidt.www.module.expert.domain.ExpertInvitationDo;
import com.unidt.www.module.expert.form.ExpertInvitationQueryForm;
import com.unidt.www.module.expert.service.IExpertInvitationService;
import com.unidt.www.module.expert.vo.ExpertInvitationVo;
import com.unidt.www.module.expert.vo.ExpertRuleUserVo;
import com.unidt.www.module.expert.vo.ExpertUserVo;
import com.unidt.www.module.expert.vo.InvitationTimeInfoVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author sk
 * @Description:
 * @Date 2022/12/15 16:09
 **/
@Api(tags = "专家邀约-查询")
@RestController
@RequestMapping("/expert/invitation_detail")
public class InvitationQueryController {

    @Autowired
    IExpertInvitationService invitationService;


    /**
     * 功能描述: 分页查询
     * @author sk
     * @date 2023/1/3
     * @param queryForm
     * @return com.unidt.www.framework.common.pojo.CommonResult<com.unidt.www.framework.common.pojo.PageResult<com.unidt.www.module.expert.domain.ExpertInvitationDo>>
     */
    @GetMapping("/pageQuery")
    @ApiOperation(value = "分页查询")
    public CommonResult<PageResult<ExpertInvitationDo>> pageQuery(ExpertInvitationQueryForm queryForm){

        return  CommonResult.success(invitationService.pageQuery(queryForm)) ;
    }

    /**
     * 功能描述: 详情
     * @author sk
     * @date 2023/1/3
     * @param id
     * @return com.unidt.www.framework.common.pojo.CommonResult<com.unidt.www.module.expert.vo.ExpertInvitationVo>
     */
    @GetMapping("/getDetail/{id}")
    @ApiOperation(value = "详情")
    public CommonResult<ExpertInvitationVo> getDetail(@PathVariable(value = "id") Long id){

        return  CommonResult.success(invitationService.getDetail(id)) ;
    }

   /**
    * 功能描述: 邀约动态
    * @author sk
    * @date 2023/1/3
    * @param id
    * @return com.unidt.www.framework.common.pojo.CommonResult<java.util.List<com.unidt.www.module.expert.vo.ExpertRuleUserVo>>
    */
    @GetMapping("/getDynamic/{id}")
    @ApiOperation(value = "邀约动态")
    public CommonResult<List<ExpertRuleUserVo>> getDynamic(@PathVariable(value = "id") Long id){

        return  CommonResult.success(invitationService.getDynamic(id)) ;
    }

    /**
     * 功能描述: 获取邀约名单
     * @author sk
     * @date 2023/1/3
     * @param id
     * @return com.unidt.www.framework.common.pojo.CommonResult<java.util.List<com.unidt.www.module.expert.vo.ExpertRuleUserVo>>
     */
    @GetMapping("/getNameList/{id}")
    @ApiOperation(value = "邀约名单")
    public CommonResult<List<ExpertRuleUserVo>> getNameList(@PathVariable(value = "id") Long id){

        return  CommonResult.success(invitationService.getNameList(id)) ;
    }

    /**
     * 功能描述: 获取备选专家名单
     * @author sk
     * @date 2023/1/3
     * @param ruleId
     * @return com.unidt.www.framework.common.pojo.CommonResult<java.util.List<com.unidt.www.module.expert.vo.ExpertUserVo>>
     */
    @GetMapping("/getLeftList/{ruleId}")
    @ApiOperation(value = "获取备选专家名单")
    public CommonResult<List<ExpertUserVo>> getLeftList(@PathVariable(value = "ruleId") Long ruleId){

        return  CommonResult.success(invitationService.getLeftList(ruleId)) ;
    }

    /**
     * 功能描述: 邀约实时状况
     * @author sk
     * @date 2023/1/3
     * @param id
     * @return com.unidt.www.framework.common.pojo.CommonResult<com.unidt.www.module.expert.vo.InvitationTimeInfoVo>
     */
    @GetMapping("/getInvitation_time_info/{id}")
    @ApiOperation(value = "邀约实时状况")
    public CommonResult<InvitationTimeInfoVo> getInvitationTimeInfo(@PathVariable(value = "id") Long id){

        return  CommonResult.success(invitationService.getInvitationTimeInfo(id)) ;
    }


}
